/**
 * @fileOverview Gruntfile
 * @author: burning <www.cafeinit.com>
 * @date: 2015-08-01
 */


'use strict';

module.exports = function (grunt) {
  // require('time-grunt')(grunt);

  var config = {
    src: 'src/',
    dist: 'dist/',
    bower: 'bower_components/'
  };

  grunt.initConfig({
    config: config,

    clean: {
      main: {
        src: '<%= config.dist %>**/*',
        filter: function (filepath) {
          console.log('clean', filepath);
          return true;
        }
      }
    },

    copy: {
      libs: {
        files: [
          {
            expand: true,
            cwd: '<%= config.bower %>jquery/dist/',
            src: ['jquery.js', 'jquery.min.js', 'jquery.min.map'],
            dest: '<%= config.src %>js/libs/'
          }
        ]
      }
    },

    less: {
      main: {
        // options: {},
        files: {
          '<%= config.src %>css/common.css': '<%= config.src %>less/common.less'
        }
      }
    },

    // concat: {
    //   common: {
    //     src: [],
    //     dest: '<%= config.src %>/js/common.js'
    //   }
    // }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-copy');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-concat');

  grunt.registerTask('default', ['clean', 'copy', 'less']);
};
